#!/bin/sh

DDIR=`echo $0 | sed 's,[^/]*$,,'`
cd $DDIR
PWD=`pwd`
for i in lib/*;
        do CLASSPATH=$PWD/$i:"$CLASSPATH";
done

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib
export CLASSPATH=$CLASSPATH

if test "$1" != ""
then
	SERVERGROUP=$1
else
	SERVERGROUP=-1
fi

while :
do
	java -Xmx1024M -Xloggc:tor.log com.terren.torDeal.Main $SERVERGROUP
	sleep 60
done
